package cbsc.cha4;

import java.io.*;
public class JudgementTester {
	Judgement checker; 
	public static void main(String[] args) {
		/*
		ArrayList<Integer> list1 = new ArrayList <Integer>();
		ArrayList<Integer> list2 = new ArrayList <Integer>();
		
		list1 = p.readCSVPractice(new File ("results2.txt"));
		list2 = p.readCSVPractice(new File ("results3.txt"));
		
		Integer[] arrayA = new Integer[list1.size()];
		Integer[] arrayB = new Integer[list2.size()];
		
		System.out.println(list1.toArray(arrayA));
		checker.evaluate(new File ("exercise1.txt"), list2.toArray(arrayB));
		checker.statisticsReport();	
		
		*/
		JudgementTester tester = new JudgementTester();
		tester.testAddition();
		tester.testSubstact();
		tester.testMix();
		tester.testAdd();
	}
	// test1: evaluate exercise and result files 
	public void testAddition() {
		checker = new Judgement(); 
		System.out.println("TEST1: read add exercise and results files and compare them");
		
		checker.evaluate(new File ("exercise_add_50_3.txt"), new File ("answers_add_50_3.txt"));
        
		checker.statisticsReport();
	}
	// test3: evaluate exercise and result files containing wild characters
	public void testMix() {
		checker = new Judgement(); 
		System.out.println("TEST3:  read mix exercise and results files and compare them");
		
		checker.evaluate(new File ("exercise_mix_50_3.txt"), new File ("answers_mix_50_3.txt"));
        
		checker.statisticsReport();
	}
	// test2: evaluate exercise and result files containing wild characters
	public void testSubstact() {
		checker = new Judgement(); 
		System.out.println("TEST2: read sub exercise and results files and compare them");
		
		checker.evaluate(new File ("exercise_sub_60_3.txt"), new File ("answers_sub_60_3.txt"));
        
		checker.statisticsReport();
	}
	// test4: evaluate exercise in file and result in a list 
	public void testAdd() {
		checker = new Judgement(); 
		System.out.println("TEST4: read add exercise and compare with results in Array");
		Integer [] results = {99,15,96,92,67,84,46,97,97,83,-1,38,79,56,95,48,66,39,16,96,99,95,96,79,97,84,63,88,48,50,86,32,93,98,10,91,37,45,97,88,84,86,58,89,62,89,96,87,100,99};
		checker.evaluate(new File ("exercise_add_50_3.txt"), results);
        
		checker.statisticsReport();
	}
}
